package control;
import java.net.Authenticator;
import java.net.PasswordAuthentication;


/** NAO ESTA SENDO USADO, so para testes...
 * SimpleAuthenticator
 * @author Adriano de Albuquerque Batista
 * @author Alfeu Buriti
 * @author Pablo Diego Alencar
 * @author Yuri Cariry Cabral de Melo
 *
 */
public class SimpleAuthenticator extends Authenticator {
	private String username, password;
	
	/**
	 * SimpleAuthenticator
	 * @param username username
	 * @param password password
	 */
	public SimpleAuthenticator(String username, String password) {
		System.out.println("Inicio do SimpleAuthenticator  ");
		
		this.username = username;
		this.password = password;

		System.out.println("Inicio do SimpleAuthenticator  ");
	}  
 
	
	/**
	 * PasswordAuthentication
	 * @return PasswordAuthentication PasswordAuthentication
	 */
	protected PasswordAuthentication getPasswordAuthentication() {
		System.out.println("Inicio do SimpleAuthenticator ->PasswordAuthentication  ");
		System.out.println("Fim do SimpleAuthenticator ->PasswordAuthentication  ");
		return new PasswordAuthentication(username, password.toCharArray());
	}
}
